var db = require('../utils/db');

class UserModel {

  constructor() {
    this.model = db.model('users', {
      username: String,
      password: String
    })
  }

  save(data) {
    let model = new this.model(data)
    return model.save();
  }

  findOne(data) {
    return this.model.findOne(data);
  }

}

module.exports = new UserModel();